package ar.com.gestion.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JTextField;

import ar.com.gestion.bo.ProductoBO;
import ar.com.gestion.bo.UsuariosBO;
import ar.com.gestion.springcontext.SpringContext;
import ar.com.gestion.vistas.ViewEliminarProducto;

public class EliminarProductoListener implements ActionListener {

	private ProductoBO productoBO = (ProductoBO) SpringContext.getContext()
			.getBean("productoBO");
	private ViewEliminarProducto contexto;
	
	public EliminarProductoListener(ViewEliminarProducto jframe){
		
		contexto =jframe;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
	productoBO.eliminarProducto(Integer.parseInt(contexto.getTextField().getText()));
	contexto.dispose();
	}

}
